<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\Database\Model\Events\Created;

/**
 * @property int $id 
 * @property int $room_type 
 * @property \Carbon\Carbon $created_at 
 * @property int $shop_id 
 * @property int $user_id 
 */
class FlyTalkRoom extends CloudBase
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'fly_talk_room';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'string', 'room_type' => 'integer', 'created_at' => 'datetime', 'shop_id' => 'string', 'user_id' => 'string'];

    public function talk_log()
    {
        return $this->hasMany(FlyTalkLog::class,'room_id','id')->orderBy('id','DESC')->limit(20);
    }
}